package cn.mst.vrs.dal.mysql.pay;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.mst.vrs.controller.admin.pay.vo.PayPageReqVO;
import cn.mst.vrs.dal.dataobject.pay.PayDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 支付单 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface PayMapper extends BaseMapperX<PayDO> {

    default PageResult<PayDO> selectPage(PayPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayDO>()
                .eqIfPresent(PayDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(PayDO::getDueAmount, reqVO.getDueAmount())
                .eqIfPresent(PayDO::getRealAmount, reqVO.getRealAmount())
                .eqIfPresent(PayDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PayDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayDO::getId));
    }

}